<!DOCTYPE html>
<html lang="en">
<head>
    <meta name="description" content="后台管理">
    <!-- Twitter meta-->
    <title>查看帖子</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- Main CSS-->
    <link rel="stylesheet" type="text/css" href="../../public/admin/css/main.css">
    <!-- Font-icon css-->
    <link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
    <style>
        body{overflow-x:hidden; background:#f2f0f5; padding:15px 0px 10px 5px;}
        #searchmain{ font-size:12px;}
        #search{ font-size:12px; background:#548fc9; margin:10px 10px 0 0; display:inline; width:100%; color:#FFF}
        #search form span{height:40px; line-height:40px; padding:0 0px 0 10px; float:left;}
        #search form input.text-word{height:24px; line-height:24px; width:180px; margin:8px 0 6px 0; padding:0 0px 0 10px; float:left; border:1px solid #FFF;}


        #search a:hover.add{ text-decoration:underline; color:#d2e9ff;}
        #main-tab{ border:1px solid #eaeaea; background:#FFF; font-size:12px;}

        #main-tab td{ font-size:12px; line-height:40px;}
        #main-tab td a{ font-size:12px; color:#548fc9;}
        #main-tab td a:hover{color:#565656; text-decoration:underline;}
        .bordertop{ border-top:1px solid #ebebeb}
        .borderright{ border-right:1px solid #ebebeb}
        .borderbottom{ border-bottom:1px solid #ebebeb}
        .borderleft{ border-left:1px solid #ebebeb}
        .gray{ color:#dbdbdb;}
        td.fenye{ padding:10px 0 0 0; text-align:right;}
        .bggray{ background:#f9f9f9; font-size:14px; font-weight:bold; padding:10px 10px 10px 0; width:120px;}
        .main-for{ padding:10px;}
        .main-for input.text-word{ width:310px; height:36px; line-height:36px; border:#ebebeb 1px solid; background:#FFF; font-family:"Microsoft YaHei","Tahoma","Arial",'宋体'; padding:0 10px;}
        .main-for select{ width:310px; height:36px; line-height:36px; border:#ebebeb 1px solid; background:#FFF; font-family:"Microsoft YaHei","Tahoma","Arial",'宋体'; color:#666;}
        .main-for input.text-but{ width:100px; height:40px; line-height:30px; border: 1px solid #cdcdcd; background:#e6e6e6; font-family:"Microsoft YaHei","Tahoma","Arial",'宋体'; color:#969696; float:left; margin:0 10px 0 0; display:inline; cursor:pointer; font-size:14px; font-weight:bold;}
        td{ background:#fcf8e3; line-height: 50px }
        .success{ background: #bee5eb;}
    </style>
</head>
<body class="app sidebar-mini rtl">
<?php if(!empty($_COOKIE['uname']) && !empty($_COOKIE['auth'])) { ?>

<?php require 'menu.php'?>
    <!-- Sidebar menu-->
    <main class="app-content">
        <div class="app-title">
            <div>
                <h1><i class="fa fa-dashboard"></i> 查看帖子</h1>
            </div>

        </div>


                        <?php
                               require 'config.php';
                               $title = $_GET['title'];
                               $id = $_GET['id'];
                               $sql = "select user.userName,post.title,post.content,post.ctime from user,post where user.id=post.uid and post.recycle= 0 and title = '$title'";
                               $relut = mysqli_query($link,$sql);
                               while($rows = mysqli_fetch_assoc($relut)){
                                   echo " <div class=\"form-group\">
                                          <label for=\"exampleInputPassword1\">id</label>
                                 <input type=\"text\" class=\"form-control\" id=\"exampleInputPassword1\" readonly name=\"auth\" value=' $id '>
                                </div>";
                                   echo " <div class=\"form-group\">
                                          <label for=\"exampleInputPassword1\">帖子标题</label>
                                 <input type=\"text\" class=\"form-control\" id=\"exampleInputPassword1\" readonly name=\"auth\" value=\" $title  \">
                                </div>";
                                   echo " <div class=\"form-group\">
                                          <label for=\"exampleInputPassword1\">帖子内容</label>
                                 <textarea class=\"form-control\" id=\"exampleInputPassword1\" rows=\"10\" cols=\"20\" readonly name=\"auth\" value=\" \">
                                 {$rows['content']}
                                 </textarea>
                                </div>";
                                   echo " <div class=\"form-group\">
                                          <label for=\"exampleInputPassword1\">发帖时间</label>
                                 <input type=\"text\" class=\"form-control\" id=\"exampleInputPassword1\" readonly name=\"auth\" value=\"{$rows['ctime']}\">
                                </div>";
                                   echo " <div class=\"form-group\">
                                          <label for=\"exampleInputPassword1\">作者</label>
                                 <input type=\"text\" class=\"form-control\" id=\"exampleInputPassword1\" readonly name=\"auth\" value=\"{$rows['userName']}\">
                                </div>";
                                   echo "</tr>";
                               }
                        ?>
        <a style="line-height:35px; height: 35px; width: 100px; background: #fff;float: right; text-align: center; color:#000; font-size: 16px; " href="post.php">返回</a>

    </main>

    <script src="../../public/admin/js/jquery-3.2.1.min.js"></script>
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script type="text/javascript" src="https://cdn.bootcss.com/Swiper/3.4.2/js/swiper.jquery.min.js"></script>
    <script src="../../public/admin/js/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="../../public/admin/js/xadmin.js"></script>
    <script src="../../public/admin/js/popper.min.js"></script>
    <script src="../../public/admin/js/bootstrap.min.js"></script>
    <script src="../../public/admin/js/main.js"></script>
    <script src="../../public/admin/js/plugins/pace.min.js"></script>
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script type="text/javascript" src="https://cdn.bootcss.com/Swiper/3.4.2/js/swiper.jquery.min.js"></script>
    <script src="../../public/admin/js/lib/layui/layui.js" charset="utf-8"></script>
    <?php
}else{
    echo "<script>alert('你还没登录');window.location.href='../index.php';</script>";die;
}
?>
<script>
    function x_admin_show(title,url,w,h){
        if (title == null || title == '') {
            title=false;
        };
        if (url == null || url == '') {
            url="404.html";
        };
        if (w == null || w == '') {
            w=800;
        };
        if (h == null || h == '') {
            h=($(window).height() - 50);
        };
        layer.open({
            type: 2,
            area: [w+'px', h +'px'],
            fix: false, //不固定
            maxmin: true,
            shadeClose: true,
            shade:0.4,
            title: title,
            content: url
        });
    }
    function member_add(title,url,w,h){
        x_admin_show(title,url,w,h);
    }
</script>
</body>
</html>
